#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;

#endregion

namespace EstateNuke.BusinessSystem.Controls.ToolbarControl
{
    public partial class ToolbarControl : UserControl
    {
        public ToolbarControl()
        {
            InitializeComponent();
        }

        protected void ToolBar_ButtonClick(Object obj, ToolBarButtonClickEventArgs e)
        {
            switch (e.Button.Tag.ToString())
            {
                case "SaveAndAdd":
                    if (SaveAndAddButtonClick != null)
                    {
                        SaveAndAddButtonClick(obj, e);
                    }
                    break;
                case "SaveAndClose":
                    if (SaveAndCloseButtonClick != null)
                    {
                        SaveAndCloseButtonClick(obj, e);
                    }
                    break;
                case "Close":
                    if (CloseButtonClick != null)
                    {
                        CloseButtonClick(obj, e);
                    }
                    break;
                case "Print":
                    if (PrintButtonClick != null)
                    {
                        PrintButtonClick(obj, e);
                    }
                    break;
            }

        }
        public event EventHandler SaveAndAddButtonClick;
        public event EventHandler SaveAndCloseButtonClick;
        public event EventHandler CloseButtonClick;
        public event EventHandler PrintButtonClick;

        public bool SaveAndAddVisible
        {
            set
            {
                mobjToolBarButtonSaveAndAdd.Visible = value;
            }
        }

        public bool PrintVisible
        {
            set { mobjToolBarButtonPrint.Visible = value; }
        }
    }
}